package com.sikaryofficial.backend;

import com.sikaryofficial.backend.config.StoreConfig;
import com.sikaryofficial.backend.domain.dto.resp.SearchSelectionDTO;
import com.sikaryofficial.common.core.domain.R;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : wuweihong
 * @desc : TODO  请填写你的功能描述
 * @date : 2025-08-21
 */

@RestController
@RequestMapping("/search")
@Tag(name = "搜索")
public class SearchSelectionController {

	@Autowired
	private StoreConfig  storeConfig;

	@GetMapping("/selection")
	@ApiOperation(value = "搜索选择条件")
	public R<SearchSelectionDTO> getSearchSelection() {
		SearchSelectionDTO searchSelectionDTO = new SearchSelectionDTO();
		searchSelectionDTO.setDistance(storeConfig.getDistance());
		searchSelectionDTO.setShopType(storeConfig.getShopType());
		searchSelectionDTO.setSortType(storeConfig.getSortType());
		return R.ok(searchSelectionDTO);
	}

}
